package com.wiscamp.ninechapters.panels.domain.repositories;

import com.wiscamp.ninechapters.panels.domain.entities.Permission;
import cube.ddd.common.query.PagedObjects;
import cube.ddd.common.query.PagedQuery;

import java.util.Collection;

public interface PermissionRepository {

    Permission getPermission(long permissionId);

    Permission getPermissionByCode(long appId, String permissionCode);

    Collection<Permission> getPermissionsByGroup(long appId, String permissionGroup);

    Collection<Permission> getPermissionsByName(long appId, String permissionName);

    Collection<Permission> getPermissionsByIds(Collection<Long> permissionIds);

    PagedObjects<Permission> getPermissionsByQuery(PagedQuery query);

    Permission savePermission(Permission permission);
}
